{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "ecb0bf93-d326-4244-90b0-02712510d67f",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/root/workspace/miniconda3/envs/dify/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
      "  from .autonotebook import tqdm as notebook_tqdm\n",
      "None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.\n",
      "/root/workspace/miniconda3/envs/dify/lib/python3.10/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work\n",
      "  warn(\"Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work\", RuntimeWarning)\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "import sys\n",
    "from collections.abc import Generator\n",
    "\n",
    "sys.path.append(\"../../../../../api\")\n",
    "\n",
    "from core.model_runtime.entities.llm_entities import LLMResult, LLMResultChunk, LLMResultChunkDelta\n",
    "from core.model_runtime.entities.message_entities import AssistantPromptMessage, SystemPromptMessage, UserPromptMessage\n",
    "from core.model_runtime.errors.validate import CredentialsValidateFailedError\n",
    "from core.model_runtime.model_providers.inscode.llm.llm import InscodeLargeLanguageModel\n",
    "from core.model_runtime.model_providers.inscode.text_embedding.text_embedding import InscodeTextEmbeddingModel\n",
    "model = InscodeLargeLanguageModel()\n",
    "emb  = InscodeTextEmbeddingModel()\n",
    "credentials={\n",
    "        'inscode_api_url': 'http://172.16.2.39:7861',\n",
    "        'inscode_api_key': 'dify'\n",
    "    }"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "2f5d7043-26a9-405e-85a8-d33dec0358a5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "api url: http://172.16.2.39:7861/api/v1/chat/completions\n"
     ]
    }
   ],
   "source": [
    "model.validate_credentials(\n",
    "    model='chat_default',\n",
    "    credentials=credentials\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "90a4561d-f5f7-41e7-8bbd-f9735b0fe999",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "api url: http://172.16.2.39:7861/api/v1/chat/completions\n",
      "我是\n",
      "阿里\n",
      "云\n",
      "研发\n",
      "的大\n",
      "规模\n",
      "语言\n",
      "模型\n",
      "，\n",
      "我\n",
      "叫\n",
      "通\n",
      "义\n",
      "千\n",
      "问\n",
      "。\n"
     ]
    }
   ],
   "source": [
    "response = model.invoke(\n",
    "        model='chat_qwen7b',\n",
    "        credentials=credentials,\n",
    "        prompt_messages=[\n",
    "            UserPromptMessage(\n",
    "                content='你是谁'\n",
    "            )\n",
    "        ],\n",
    "        model_parameters={\n",
    "            'temperature': 0.5,\n",
    "            'max_tokens': 10\n",
    "        },\n",
    "        stream=True,\n",
    "        user=\"abc-123\"\n",
    "    )\n",
    "for chunk in response:\n",
    "    print(chunk.delta.message.content)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "c24e0b5a-142d-4bf0-9a0d-271333106175",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "12\n"
     ]
    }
   ],
   "source": [
    "num_tokens = model.get_num_tokens(\n",
    "        model='chat_qwen7b',\n",
    "        credentials=credentials,\n",
    "        prompt_messages=[\n",
    "            UserPromptMessage(\n",
    "                content='我叫王晗,你是谁'\n",
    "            )\n",
    "        ]\n",
    "    )\n",
    "print(num_tokens)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ea796b9d-6537-4689-b323-4bd7dd5dc684",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model='gte-base-1024' embeddings=[[0.0073806592263281345, -0.008166998624801636, -0.0022738617844879627, -0.004565947223454714, -0.03520304337143898, 0.002134058391675353, -0.017045235261321068, -0.006309738848358393, 0.0302033182233572, 0.01572425849735737, 0.0394434928894043, -0.007494240067899227, 0.0034367016050964594, -0.0614401176571846, 0.03948140889406204, 0.03791140392422676, 0.0032264438923448324, 0.010094531811773777, -0.03768591582775116, 0.002917342120781541, -0.05388195440173149, 0.024498246610164642, 0.03857196867465973, 0.005975787527859211, -0.028111740946769714, 0.012322548776865005, -0.0007294777315109968, 0.0364629328250885, 0.016920603811740875, 0.004341137129813433, 0.01816706918179989, 0.015539443120360374, -0.02543654851615429, -0.006499629933387041, -0.011942502111196518, -0.01307772658765316, -0.007401182781904936, -0.03760068863630295, 0.0018737625796347857, -0.009735921397805214, 0.0033595517743378878, -0.0014521692646667361, 0.03556348755955696, -0.07861354202032089, -0.008669080212712288, 0.016866784542798996, 0.01831609569489956, -0.024554867297410965, -0.04606563225388527, -0.045234695076942444, 0.0696503072977066, 0.36576762795448303, 0.042140498757362366, 0.015506253577768803, -0.007206595968455076, 0.00823382567614317, -0.03484231233596802, -0.008456002920866013, 0.04405264928936958, -0.018006468191742897, 0.004271355457603931, -0.01784154213964939, 0.037887003272771835, -0.021532732993364334, -0.03077772632241249, -0.008699500001966953, -0.026044635102152824, -0.011201576329767704, 0.015249129384756088, 0.01650596782565117, -0.029718099161982536, -0.023960085585713387, 0.019464628770947456, 0.01532001979649067, 0.039812784641981125, -0.03818130120635033, -0.0035828363616019487, -0.022705409675836563, -0.030326448380947113, -0.021477768197655678, 0.029187185689806938, 0.004252019803971052, -0.05299112945795059, 0.024107009172439575, 0.002653780160471797, -0.004110636655241251, -0.04102319851517677, -0.010564040392637253, -0.04695209860801697, 0.015563098713755608, -0.010148383677005768, -0.009738638997077942, -0.017816301435232162, 0.007286179345101118, -0.013070355169475079, -0.017628639936447144, 0.005158805288374424, 0.05539592728018761, 0.03446022421121597, 0.02561352401971817, -0.01506947074085474, 0.03403631970286369, -0.051838506013154984, 0.017876937985420227, -0.011430065147578716, 0.004678593948483467, 0.0800645500421524, 0.028943000361323357, -0.007358130998909473, 0.04625103250145912, -0.008002963848412037, 0.016361147165298462, -0.0184555072337389, 0.0031834859400987625, -0.009504102170467377, -0.011822712607681751, 0.021134449169039726, -0.007519150152802467, 0.02304096147418022, -0.01978667452931404, -0.008183999918401241, 0.011298620142042637, 0.029985468834638596, 0.0333816334605217, 0.008965391665697098, -0.001107695046812296, 0.046349480748176575, 0.010504283010959625, -0.01030260045081377, -0.008472977206110954, -0.08124090731143951, -0.03838526830077171, -0.025688793510198593, -0.007280884776264429, 0.0006103118066675961, 0.01969284564256668, -0.01037026010453701, -0.007578281220048666, 0.05405893176794052, -0.056242506951093674, -0.0032419590279459953, 0.0024025882594287395, -0.023290056735277176, -0.0017838538624346256, -0.08337350934743881, -0.03334644064307213, -0.014525526203215122, -0.00658279238268733, -0.02862009033560753, 0.02368183620274067, 0.09569188207387924, 0.0014907484874129295, -0.0028067806269973516, -0.007043526042252779, 0.004065491259098053, 0.04247912019491196, -0.06662371754646301, -0.016022341325879097, -0.08017361909151077, -0.033268023282289505, -0.043251052498817444, 0.008911010809242725, 0.028581181541085243, 0.02972503751516342, 0.0056628757156431675, -0.06833937764167786, 0.030761675909161568, -0.010844612494111061, 0.011185129173099995, -0.042984046041965485, -0.01095698494464159, -0.002225910546258092, 0.009472117759287357, 0.0019408422522246838, -0.0025533519219607115, -0.004735477734357119, -0.01500701904296875, -0.0006434179376810789, -0.001979461405426264, 0.03588513284921646, 0.06912580132484436, -0.014826808124780655, 0.008379194885492325, -0.045562636107206345, -0.0035367084201425314, 0.00953121017664671, -0.04172619804739952, 0.026344044134020805, 0.008637337014079094, 0.05186161771416664, -0.016949662938714027, -0.015873728320002556, -0.0036720396019518375, 0.07531394809484482, 0.004844032693654299, 0.011186184361577034, -0.056035205721855164, -0.06381325423717499, -0.03963166102766991, -0.02113703265786171, -0.006470018532127142, 0.014831616543233395, -0.0014480993850156665, 0.04778680205345154, 0.01271866075694561, -0.033168841153383255, -0.02800700068473816, 0.05023330822587013, 0.0006453933892771602, 0.007864320650696754, 0.042620256543159485, 0.004066533409059048, 0.006942227948457003, -0.014048989862203598, -0.011331622488796711, -0.025364946573972702, -0.018686367198824883, 0.03822137787938118, -0.03203781694173813, -0.011034545488655567, 0.007307618856430054, 0.0016248455503955483, 0.0004321021551731974, -0.03967852145433426, 0.00338520179502666, -0.022157130762934685, -0.1007675901055336, -0.029405813664197922, 0.036741044372320175, -0.09957366436719894, -0.006757104769349098, -0.03424458205699921, -0.03260334953665733, 0.017449932172894478, -0.005705646704882383, -0.022668693214654922, -0.05225792154669762, 0.00950668565928936, 0.018531497567892075, -0.007258214056491852, -0.01739327609539032, 0.01809363253414631, -0.00909823551774025, -0.06157134100794792, 0.0022730149794369936, 0.006709612440317869, 0.02277785912156105, -0.008775049820542336, -0.013630415312945843, 0.01028385292738676, 0.028749769553542137, -0.031017107889056206, -0.02396947331726551, -0.015011290088295937, 0.026342814788222313, -0.04476555809378624, -0.017905540764331818, -0.03049674816429615, 0.062363650649785995, -0.00200265902094543, 0.00012004264135612175, -0.016099443659186363, -0.04214095324277878, -0.0032991827465593815, -0.01468732487410307, -0.0802055299282074, 0.02122521586716175, -0.03378010168671608, -0.043642327189445496, 0.05370514839887619, -0.005569618660956621, 0.003446951974183321, 0.001126552582718432, -0.06160111352801323, -0.04915567860007286, -0.014761196449398994, -0.00849264208227396, 0.016181491315364838, 0.01782377064228058, 0.0010165327694267035, -0.02367757260799408, 0.003114162478595972, 0.01447525154799223, -0.011526976712048054, 0.057266831398010254, 0.0046188016422092915, -0.012314951978623867, -0.030095688998699188, -0.052207477390766144, 0.09043768048286438, -0.01471942849457264, -0.05927865207195282, -0.02447323314845562, -0.008855385705828667, 0.30564799904823303, 0.022262440994381905, 0.01200871728360653, 0.0021700591314584017, 0.04860357567667961, 0.03250780329108238, -0.007424851413816214, 0.010672295466065407, -0.0009243498207069933, -0.01393825188279152, -0.011219080537557602, 0.0315202921628952, 0.015911297872662544, 0.06053885817527771, 0.03319232910871506, -0.01324453018605709, -0.014810683205723763, -0.007806053385138512, -0.04048842564225197, -0.014339303597807884, 0.040257297456264496, 0.0008574000676162541, -0.007296113297343254, -0.04889152944087982, -0.025320591405034065, -0.00682452879846096, 0.04111894220113754, -0.02141326479613781, -0.00626074243336916, 0.010938943363726139, 0.017727015540003777, 0.0815114974975586, -0.029760019853711128, -0.03762765973806381, -0.07826355844736099, -0.08664354681968689, -0.031288936734199524, 0.004217466805130243, -0.006531938444823027, 0.01963983103632927, 0.012207567691802979, 0.0590515173971653, 0.03951961174607277, -0.01953427866101265, 0.00569503428414464, -0.023408809676766396, 0.03352326154708862, -0.01570720225572586, -0.007104713469743729, -0.014968869276344776, -0.04576365649700165, -0.0029241598676890135, 0.07707874476909637, -0.027946148067712784, -0.011851153336465359, 0.05602855980396271, -0.007976719178259373, -0.01249636895954609, -0.0424349419772625, -0.02475696988403797, -0.020353125408291817, 0.020318886265158653, -0.06992961466312408, -0.01649095118045807, 0.019349947571754456, -0.02356678992509842, 0.04208478704094887, 0.03558051213622093, -0.015937138348817825, 0.01943347416818142, -0.022820837795734406, -0.056279294192790985, 0.006682493723928928, -0.030612213537096977, 0.011926909908652306, 0.010218118317425251, 0.03194228187203407, 0.004847572185099125, 0.005251871421933174, 0.07792030274868011, -0.038546930998563766, 0.00012666043767239898, 0.015816835686564445, -0.03161599114537239, -0.009768135845661163, -0.03278893232345581, -0.0008332111756317317, -0.05671842396259308, -0.0542437918484211, 0.002451334148645401, 0.011983987875282764, -0.005539504811167717, 0.03681979700922966, -0.03319493681192398, -0.006802847143262625, -0.027114247903227806, -0.039284296333789825, -0.0021553414408117533, -0.0006786551675759256, -0.012175461277365685, 0.0058822836726903915, -0.1027519702911377, 0.00614984380081296, -0.027520447969436646, 0.009103057906031609, 0.02140750177204609, -0.009491071105003357, 0.02773100510239601, 0.058288875967264175, -0.02720506116747856, 0.010091942735016346, -0.03407078608870506, -0.008630202151834965, -0.03373812511563301, 0.03143917769193649, 0.007433431688696146, -0.040165189653635025, 0.0076562692411243916, -0.05724426731467247, 0.00409283023327589, -0.009885805658996105, -0.018161054700613022, 0.05957233905792236, 0.03364213556051254, 0.029583480209112167, -0.011763575486838818, -0.016404325142502785, -0.003612508298829198, 0.06288905441761017, -0.0349840447306633, -0.012216288596391678, 0.014046138152480125, 0.007568222936242819, 0.03592042252421379, -0.020640401169657707, 0.0012896732660010457, 0.00792780239135027, -0.06785552203655243, -0.0024791057221591473, -0.06361234188079834, 0.04192892089486122, 0.0048119197599589825, -0.027289031073451042, -0.06537602841854095, -0.019305335357785225, -0.004306042566895485, -0.07040784507989883, -0.010127207264304161, 0.0183503869920969, 0.01006697304546833, -0.019452951848506927, -0.01682649739086628, 0.05422161519527435, -0.02908753789961338, -0.052567534148693085, 0.013563837856054306, -0.009344478137791157, -0.041559912264347076, 0.04777834191918373, -0.0031907004304230213, 0.005449765827506781, -0.007202147971838713, 0.030705800279974937, -0.03882915526628494, 0.006826953962445259, 0.036278676241636276, 0.007811627350747585, 0.0038595229852944613, -0.004095152486115694, 0.03427803888916969, 0.027315892279148102, 0.06415469944477081, -0.02062574215233326, -0.021805858239531517, 0.032585110515356064, -0.010941904969513416, 0.030148286372423172, -0.010981494560837746, 0.032651450484991074, -0.04714353755116463, -0.020151648670434952, -0.030821936205029488, 0.05118681117892265, 0.010682571679353714, -0.011786086484789848, -0.034475188702344894, 0.06583800911903381, 0.019743995741009712, -0.005803527310490608, -0.013096662238240242, 0.01406731829047203, -0.01205414067953825, -0.0002997439878527075, 0.0144542520865798, -0.015445737168192863, -0.008425231091678143, -0.016521185636520386, 0.007560970727354288, 0.010051645338535309, 0.02137380838394165, -0.04847843199968338, -0.01729976013302803, 0.017346395179629326, 0.04591936990618706, -0.02160285972058773, -0.0057703354395926, -0.026934923604130745, 0.0037849005311727524, -0.011528289876878262, 0.022355500608682632, -0.013537181541323662, -0.008331220597028732, -0.012633610516786575, -0.01381551381200552, 0.06255723536014557, 0.005252429284155369, -0.009184757247567177, -0.015298371203243732, -0.011336822994053364, -0.000636701297480613, -0.01724921353161335, -0.02407265268266201, 0.0018565704813227057, 0.023573122918605804, 0.007636356167495251, 0.026079952716827393, -0.047071926295757294, 0.014923036098480225, -0.034720536321401596, 0.02274991013109684, 0.02399258315563202, 0.00375674432143569, -0.01137792319059372, -0.001581563730724156, -0.03625902533531189, 0.0617537796497345, -0.06055646762251854, -0.004763429518789053, -0.027782516553997993, -0.01350482553243637, 0.07578625530004501, 0.010922352783381939, -0.024950237944722176, -0.013479829765856266, 0.057793062180280685, -0.0019066383829340339, 0.0012503195321187377, 0.05680156126618385, 6.038906576577574e-05, -0.020877256989479065, 0.006477097515016794, 0.027607066556811333, 0.02266010455787182, 0.0483880415558815, 0.01140572503209114, -0.00450139632448554, -0.044418975710868835, 0.013483941555023193, -0.007332506589591503, -0.0036764126271009445, -0.012700963765382767, -0.008283372968435287, -0.03320474550127983, -0.0036120829172432423, 0.051489170640707016, -0.02111121639609337, -0.030833879485726357, 0.046656470745801926, 0.0010060141794383526, 0.029795043170452118, -0.005301813129335642, -0.022455381229519844, -0.08769358694553375, -0.013106065802276134, 0.0036325848195701838, -0.09512951970100403, 0.05061842501163483, 0.020480716601014137, -0.00812998041510582, 0.05946175009012222, -0.006739032920449972, 0.01593363657593727, 0.00694293575361371, -0.021986253559589386, 0.009584203362464905, 0.019718797877430916, -0.00952300988137722, 0.01996004581451416, -0.03618140518665314, 0.025525767356157303, -0.02538503147661686, -0.005797829013317823, 0.009734464809298515, -0.005176868289709091, 0.009503734298050404, -0.047734204679727554, -0.039366740733385086, 0.010877144522964954, 0.03501328453421593, -0.008388095535337925, -0.038901761174201965, 0.02450847066938877, -0.0046399664133787155, 0.016722457483410835, -0.052226703613996506, 0.020763689652085304, 0.03864959254860878, -0.03882536664605141, 0.01526512298732996, 0.027501290664076805, -0.0032199539709836245, 0.04048104211688042, -0.008242354728281498, 0.006164726335555315, 0.050532933324575424, -0.057124827057123184, -0.04212094843387604, 0.024567941203713417, 0.01658271811902523, 0.10517146438360214, 0.0032737997826188803, -0.013671300373971462, -0.03492742404341698, -0.01531783863902092, 0.054106492549180984, -0.05373549833893776, 0.0411086231470108, -0.017838388681411743, -0.036727696657180786, 0.01153530552983284, -0.014250509440898895, 0.02833409607410431, 0.04338975250720978, -0.05061422660946846, -0.006431825924664736, -0.014276169240474701, -0.03807118535041809, -0.023922624066472054, -0.00440997164696455, 0.0280025415122509, 0.0042798519134521484, -0.00933455303311348, -0.031644199043512344, -0.007066147401928902, 0.005458783823996782, 0.02781679481267929, 0.03278999775648117, -0.028519408777356148, -0.009945937432348728, -0.0012582492781803012, 0.009261995553970337, -0.0376303493976593, -0.019055703654885292, -0.0031955898739397526, 0.05474329739809036, -0.04556011036038399, 0.00612485921010375, 0.07800491899251938, 0.01955593191087246, -0.016690248623490334, -0.006470829714089632, -0.0017377011245116591, 0.0076773264445364475, 0.004720392636954784, 0.049052320420742035, 0.017033979296684265, 0.002085483632981777, 0.0003325550351291895, -0.004834140185266733, 0.01923220418393612, -0.016724832355976105, -0.014203994534909725, -0.014388184063136578, -0.022317122668027878, -0.054706741124391556, 0.06099638715386391, 0.039138030260801315, 0.0015888436464592814, 0.03537352383136749, 0.006799064576625824, 0.010027782060205936, -0.015445689670741558, -0.006812520790845156, 0.01836186833679676, -0.05224000662565231, 0.01379299070686102, -0.04091084748506546, -0.012155970558524132, 0.007083398289978504, 0.01745401695370674, -0.004345799796283245, -0.01394018903374672, 0.01190063264220953, 0.006264544557780027, -0.010990811511874199, 0.02789285220205784, -0.01643439568579197, 0.036597929894924164, 0.014594976790249348, -0.020884370431303978, 0.009451867081224918, 0.14932465553283691, -0.05749255418777466, -0.009910146705806255, -0.017921986058354378, -0.02411647140979767, 0.040553558617830276, 0.015910720452666283, 0.004087766632437706, -0.07585053145885468, -0.004404752515256405, -0.041539959609508514, 0.03819143399596214, -0.005743307992815971, 0.04058704525232315, -0.008798099122941494, 0.022050920873880386, -0.060121193528175354, 0.013004169799387455, 0.010248459875583649, -0.00971163623034954, -0.0014004865661263466, 0.029527192935347557, 0.02066289260983467, 0.03607502952218056, -0.0013253266224637628, 0.019731104373931885, -0.06858145445585251, 0.004605697933584452, -0.0033920835703611374, -0.016833489760756493, 0.016499796882271767, -0.03222278505563736, -0.06144535169005394, 0.030162114650011063, -0.02231021411716938, -0.029742101207375526, 0.016167033463716507, -0.023932073265314102, -0.02730236016213894, 0.021338513121008873, -0.008258572779595852, -0.001745893037877977, -0.020930301398038864, -0.0058139171451330185, 0.019884459674358368, -0.015566257759928703, 0.015157409012317657, 0.08047982305288315, 0.01555826235562563, 0.03912244737148285, -0.014024664647877216, 0.0008457184303551912, 0.00641711475327611, -0.024986527860164642, 0.0006842127186246216, -0.012981698848307133, 0.014438347890973091, -0.0051102046854794025, 0.04057725891470909, 0.02946288324892521, -0.06539943069219589, -0.08063766360282898, 0.01519730407744646, 0.01443756464868784, -0.0463564395904541, -0.02257915399968624, 0.05615081265568733, -0.00493082869797945, 0.015455045737326145, -0.04196030646562576, 0.06430622190237045, 0.028780635446310043, -0.004637269768863916]] usage=EmbeddingUsage(tokens=0, total_tokens=0, unit_price=Decimal('0.0'), price_unit=Decimal('0.0'), total_price=Decimal('0.0'), currency='USD', latency=16514451.87835761)\n"
     ]
    }
   ],
   "source": [
    "emb_result=emb._invoke(\n",
    "        model=\"gte-base-1024\",\n",
    "        credentials=credentials,\n",
    "        texts=[\"hello world\"],\n",
    "        user=\"test\"\n",
    "    )\n",
    "print(emb_result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "2d6aa5b4-bf5a-45d3-83ae-3d1c028839ca",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model='gte-base-768' embeddings=[[0.0073806592263281345, -0.008166998624801636, -0.0022738617844879627, -0.004565947223454714, -0.03520304337143898, 0.002134058391675353, -0.017045235261321068, -0.006309738848358393, 0.0302033182233572, 0.01572425849735737, 0.0394434928894043, -0.007494240067899227, 0.0034367016050964594, -0.0614401176571846, 0.03948140889406204, 0.03791140392422676, 0.0032264438923448324, 0.010094531811773777, -0.03768591582775116, 0.002917342120781541, -0.05388195440173149, 0.024498246610164642, 0.03857196867465973, 0.005975787527859211, -0.028111740946769714, 0.012322548776865005, -0.0007294777315109968, 0.0364629328250885, 0.016920603811740875, 0.004341137129813433, 0.01816706918179989, 0.015539443120360374, -0.02543654851615429, -0.006499629933387041, -0.011942502111196518, -0.01307772658765316, -0.007401182781904936, -0.03760068863630295, 0.0018737625796347857, -0.009735921397805214, 0.0033595517743378878, -0.0014521692646667361, 0.03556348755955696, -0.07861354202032089, -0.008669080212712288, 0.016866784542798996, 0.01831609569489956, -0.024554867297410965, -0.04606563225388527, -0.045234695076942444, 0.0696503072977066, 0.36576762795448303, 0.042140498757362366, 0.015506253577768803, -0.007206595968455076, 0.00823382567614317, -0.03484231233596802, -0.008456002920866013, 0.04405264928936958, -0.018006468191742897, 0.004271355457603931, -0.01784154213964939, 0.037887003272771835, -0.021532732993364334, -0.03077772632241249, -0.008699500001966953, -0.026044635102152824, -0.011201576329767704, 0.015249129384756088, 0.01650596782565117, -0.029718099161982536, -0.023960085585713387, 0.019464628770947456, 0.01532001979649067, 0.039812784641981125, -0.03818130120635033, -0.0035828363616019487, -0.022705409675836563, -0.030326448380947113, -0.021477768197655678, 0.029187185689806938, 0.004252019803971052, -0.05299112945795059, 0.024107009172439575, 0.002653780160471797, -0.004110636655241251, -0.04102319851517677, -0.010564040392637253, -0.04695209860801697, 0.015563098713755608, -0.010148383677005768, -0.009738638997077942, -0.017816301435232162, 0.007286179345101118, -0.013070355169475079, -0.017628639936447144, 0.005158805288374424, 0.05539592728018761, 0.03446022421121597, 0.02561352401971817, -0.01506947074085474, 0.03403631970286369, -0.051838506013154984, 0.017876937985420227, -0.011430065147578716, 0.004678593948483467, 0.0800645500421524, 0.028943000361323357, -0.007358130998909473, 0.04625103250145912, -0.008002963848412037, 0.016361147165298462, -0.0184555072337389, 0.0031834859400987625, -0.009504102170467377, -0.011822712607681751, 0.021134449169039726, -0.007519150152802467, 0.02304096147418022, -0.01978667452931404, -0.008183999918401241, 0.011298620142042637, 0.029985468834638596, 0.0333816334605217, 0.008965391665697098, -0.001107695046812296, 0.046349480748176575, 0.010504283010959625, -0.01030260045081377, -0.008472977206110954, -0.08124090731143951, -0.03838526830077171, -0.025688793510198593, -0.007280884776264429, 0.0006103118066675961, 0.01969284564256668, -0.01037026010453701, -0.007578281220048666, 0.05405893176794052, -0.056242506951093674, -0.0032419590279459953, 0.0024025882594287395, -0.023290056735277176, -0.0017838538624346256, -0.08337350934743881, -0.03334644064307213, -0.014525526203215122, -0.00658279238268733, -0.02862009033560753, 0.02368183620274067, 0.09569188207387924, 0.0014907484874129295, -0.0028067806269973516, -0.007043526042252779, 0.004065491259098053, 0.04247912019491196, -0.06662371754646301, -0.016022341325879097, -0.08017361909151077, -0.033268023282289505, -0.043251052498817444, 0.008911010809242725, 0.028581181541085243, 0.02972503751516342, 0.0056628757156431675, -0.06833937764167786, 0.030761675909161568, -0.010844612494111061, 0.011185129173099995, -0.042984046041965485, -0.01095698494464159, -0.002225910546258092, 0.009472117759287357, 0.0019408422522246838, -0.0025533519219607115, -0.004735477734357119, -0.01500701904296875, -0.0006434179376810789, -0.001979461405426264, 0.03588513284921646, 0.06912580132484436, -0.014826808124780655, 0.008379194885492325, -0.045562636107206345, -0.0035367084201425314, 0.00953121017664671, -0.04172619804739952, 0.026344044134020805, 0.008637337014079094, 0.05186161771416664, -0.016949662938714027, -0.015873728320002556, -0.0036720396019518375, 0.07531394809484482, 0.004844032693654299, 0.011186184361577034, -0.056035205721855164, -0.06381325423717499, -0.03963166102766991, -0.02113703265786171, -0.006470018532127142, 0.014831616543233395, -0.0014480993850156665, 0.04778680205345154, 0.01271866075694561, -0.033168841153383255, -0.02800700068473816, 0.05023330822587013, 0.0006453933892771602, 0.007864320650696754, 0.042620256543159485, 0.004066533409059048, 0.006942227948457003, -0.014048989862203598, -0.011331622488796711, -0.025364946573972702, -0.018686367198824883, 0.03822137787938118, -0.03203781694173813, -0.011034545488655567, 0.007307618856430054, 0.0016248455503955483, 0.0004321021551731974, -0.03967852145433426, 0.00338520179502666, -0.022157130762934685, -0.1007675901055336, -0.029405813664197922, 0.036741044372320175, -0.09957366436719894, -0.006757104769349098, -0.03424458205699921, -0.03260334953665733, 0.017449932172894478, -0.005705646704882383, -0.022668693214654922, -0.05225792154669762, 0.00950668565928936, 0.018531497567892075, -0.007258214056491852, -0.01739327609539032, 0.01809363253414631, -0.00909823551774025, -0.06157134100794792, 0.0022730149794369936, 0.006709612440317869, 0.02277785912156105, -0.008775049820542336, -0.013630415312945843, 0.01028385292738676, 0.028749769553542137, -0.031017107889056206, -0.02396947331726551, -0.015011290088295937, 0.026342814788222313, -0.04476555809378624, -0.017905540764331818, -0.03049674816429615, 0.062363650649785995, -0.00200265902094543, 0.00012004264135612175, -0.016099443659186363, -0.04214095324277878, -0.0032991827465593815, -0.01468732487410307, -0.0802055299282074, 0.02122521586716175, -0.03378010168671608, -0.043642327189445496, 0.05370514839887619, -0.005569618660956621, 0.003446951974183321, 0.001126552582718432, -0.06160111352801323, -0.04915567860007286, -0.014761196449398994, -0.00849264208227396, 0.016181491315364838, 0.01782377064228058, 0.0010165327694267035, -0.02367757260799408, 0.003114162478595972, 0.01447525154799223, -0.011526976712048054, 0.057266831398010254, 0.0046188016422092915, -0.012314951978623867, -0.030095688998699188, -0.052207477390766144, 0.09043768048286438, -0.01471942849457264, -0.05927865207195282, -0.02447323314845562, -0.008855385705828667, 0.30564799904823303, 0.022262440994381905, 0.01200871728360653, 0.0021700591314584017, 0.04860357567667961, 0.03250780329108238, -0.007424851413816214, 0.010672295466065407, -0.0009243498207069933, -0.01393825188279152, -0.011219080537557602, 0.0315202921628952, 0.015911297872662544, 0.06053885817527771, 0.03319232910871506, -0.01324453018605709, -0.014810683205723763, -0.007806053385138512, -0.04048842564225197, -0.014339303597807884, 0.040257297456264496, 0.0008574000676162541, -0.007296113297343254, -0.04889152944087982, -0.025320591405034065, -0.00682452879846096, 0.04111894220113754, -0.02141326479613781, -0.00626074243336916, 0.010938943363726139, 0.017727015540003777, 0.0815114974975586, -0.029760019853711128, -0.03762765973806381, -0.07826355844736099, -0.08664354681968689, -0.031288936734199524, 0.004217466805130243, -0.006531938444823027, 0.01963983103632927, 0.012207567691802979, 0.0590515173971653, 0.03951961174607277, -0.01953427866101265, 0.00569503428414464, -0.023408809676766396, 0.03352326154708862, -0.01570720225572586, -0.007104713469743729, -0.014968869276344776, -0.04576365649700165, -0.0029241598676890135, 0.07707874476909637, -0.027946148067712784, -0.011851153336465359, 0.05602855980396271, -0.007976719178259373, -0.01249636895954609, -0.0424349419772625, -0.02475696988403797, -0.020353125408291817, 0.020318886265158653, -0.06992961466312408, -0.01649095118045807, 0.019349947571754456, -0.02356678992509842, 0.04208478704094887, 0.03558051213622093, -0.015937138348817825, 0.01943347416818142, -0.022820837795734406, -0.056279294192790985, 0.006682493723928928, -0.030612213537096977, 0.011926909908652306, 0.010218118317425251, 0.03194228187203407, 0.004847572185099125, 0.005251871421933174, 0.07792030274868011, -0.038546930998563766, 0.00012666043767239898, 0.015816835686564445, -0.03161599114537239, -0.009768135845661163, -0.03278893232345581, -0.0008332111756317317, -0.05671842396259308, -0.0542437918484211, 0.002451334148645401, 0.011983987875282764, -0.005539504811167717, 0.03681979700922966, -0.03319493681192398, -0.006802847143262625, -0.027114247903227806, -0.039284296333789825, -0.0021553414408117533, -0.0006786551675759256, -0.012175461277365685, 0.0058822836726903915, -0.1027519702911377, 0.00614984380081296, -0.027520447969436646, 0.009103057906031609, 0.02140750177204609, -0.009491071105003357, 0.02773100510239601, 0.058288875967264175, -0.02720506116747856, 0.010091942735016346, -0.03407078608870506, -0.008630202151834965, -0.03373812511563301, 0.03143917769193649, 0.007433431688696146, -0.040165189653635025, 0.0076562692411243916, -0.05724426731467247, 0.00409283023327589, -0.009885805658996105, -0.018161054700613022, 0.05957233905792236, 0.03364213556051254, 0.029583480209112167, -0.011763575486838818, -0.016404325142502785, -0.003612508298829198, 0.06288905441761017, -0.0349840447306633, -0.012216288596391678, 0.014046138152480125, 0.007568222936242819, 0.03592042252421379, -0.020640401169657707, 0.0012896732660010457, 0.00792780239135027, -0.06785552203655243, -0.0024791057221591473, -0.06361234188079834, 0.04192892089486122, 0.0048119197599589825, -0.027289031073451042, -0.06537602841854095, -0.019305335357785225, -0.004306042566895485, -0.07040784507989883, -0.010127207264304161, 0.0183503869920969, 0.01006697304546833, -0.019452951848506927, -0.01682649739086628, 0.05422161519527435, -0.02908753789961338, -0.052567534148693085, 0.013563837856054306, -0.009344478137791157, -0.041559912264347076, 0.04777834191918373, -0.0031907004304230213, 0.005449765827506781, -0.007202147971838713, 0.030705800279974937, -0.03882915526628494, 0.006826953962445259, 0.036278676241636276, 0.007811627350747585, 0.0038595229852944613, -0.004095152486115694, 0.03427803888916969, 0.027315892279148102, 0.06415469944477081, -0.02062574215233326, -0.021805858239531517, 0.032585110515356064, -0.010941904969513416, 0.030148286372423172, -0.010981494560837746, 0.032651450484991074, -0.04714353755116463, -0.020151648670434952, -0.030821936205029488, 0.05118681117892265, 0.010682571679353714, -0.011786086484789848, -0.034475188702344894, 0.06583800911903381, 0.019743995741009712, -0.005803527310490608, -0.013096662238240242, 0.01406731829047203, -0.01205414067953825, -0.0002997439878527075, 0.0144542520865798, -0.015445737168192863, -0.008425231091678143, -0.016521185636520386, 0.007560970727354288, 0.010051645338535309, 0.02137380838394165, -0.04847843199968338, -0.01729976013302803, 0.017346395179629326, 0.04591936990618706, -0.02160285972058773, -0.0057703354395926, -0.026934923604130745, 0.0037849005311727524, -0.011528289876878262, 0.022355500608682632, -0.013537181541323662, -0.008331220597028732, -0.012633610516786575, -0.01381551381200552, 0.06255723536014557, 0.005252429284155369, -0.009184757247567177, -0.015298371203243732, -0.011336822994053364, -0.000636701297480613, -0.01724921353161335, -0.02407265268266201, 0.0018565704813227057, 0.023573122918605804, 0.007636356167495251, 0.026079952716827393, -0.047071926295757294, 0.014923036098480225, -0.034720536321401596, 0.02274991013109684, 0.02399258315563202, 0.00375674432143569, -0.01137792319059372, -0.001581563730724156, -0.03625902533531189, 0.0617537796497345, -0.06055646762251854, -0.004763429518789053, -0.027782516553997993, -0.01350482553243637, 0.07578625530004501, 0.010922352783381939, -0.024950237944722176, -0.013479829765856266, 0.057793062180280685, -0.0019066383829340339, 0.0012503195321187377, 0.05680156126618385, 6.038906576577574e-05, -0.020877256989479065, 0.006477097515016794, 0.027607066556811333, 0.02266010455787182, 0.0483880415558815, 0.01140572503209114, -0.00450139632448554, -0.044418975710868835, 0.013483941555023193, -0.007332506589591503, -0.0036764126271009445, -0.012700963765382767, -0.008283372968435287, -0.03320474550127983, -0.0036120829172432423, 0.051489170640707016, -0.02111121639609337, -0.030833879485726357, 0.046656470745801926, 0.0010060141794383526, 0.029795043170452118, -0.005301813129335642, -0.022455381229519844, -0.08769358694553375, -0.013106065802276134, 0.0036325848195701838, -0.09512951970100403, 0.05061842501163483, 0.020480716601014137, -0.00812998041510582, 0.05946175009012222, -0.006739032920449972, 0.01593363657593727, 0.00694293575361371, -0.021986253559589386, 0.009584203362464905, 0.019718797877430916, -0.00952300988137722, 0.01996004581451416, -0.03618140518665314, 0.025525767356157303, -0.02538503147661686, -0.005797829013317823, 0.009734464809298515, -0.005176868289709091, 0.009503734298050404, -0.047734204679727554, -0.039366740733385086, 0.010877144522964954, 0.03501328453421593, -0.008388095535337925, -0.038901761174201965, 0.02450847066938877, -0.0046399664133787155, 0.016722457483410835, -0.052226703613996506, 0.020763689652085304, 0.03864959254860878, -0.03882536664605141, 0.01526512298732996, 0.027501290664076805, -0.0032199539709836245, 0.04048104211688042, -0.008242354728281498, 0.006164726335555315, 0.050532933324575424, -0.057124827057123184, -0.04212094843387604, 0.024567941203713417, 0.01658271811902523, 0.10517146438360214, 0.0032737997826188803, -0.013671300373971462, -0.03492742404341698, -0.01531783863902092, 0.054106492549180984, -0.05373549833893776, 0.0411086231470108, -0.017838388681411743, -0.036727696657180786, 0.01153530552983284, -0.014250509440898895, 0.02833409607410431, 0.04338975250720978, -0.05061422660946846, -0.006431825924664736, -0.014276169240474701, -0.03807118535041809, -0.023922624066472054, -0.00440997164696455, 0.0280025415122509, 0.0042798519134521484, -0.00933455303311348, -0.031644199043512344, -0.007066147401928902, 0.005458783823996782, 0.02781679481267929, 0.03278999775648117, -0.028519408777356148, -0.009945937432348728, -0.0012582492781803012, 0.009261995553970337, -0.0376303493976593, -0.019055703654885292, -0.0031955898739397526, 0.05474329739809036, -0.04556011036038399, 0.00612485921010375, 0.07800491899251938, 0.01955593191087246, -0.016690248623490334, -0.006470829714089632, -0.0017377011245116591, 0.0076773264445364475, 0.004720392636954784, 0.049052320420742035, 0.017033979296684265, 0.002085483632981777, 0.0003325550351291895, -0.004834140185266733, 0.01923220418393612, -0.016724832355976105, -0.014203994534909725, -0.014388184063136578, -0.022317122668027878, -0.054706741124391556, 0.06099638715386391, 0.039138030260801315, 0.0015888436464592814, 0.03537352383136749, 0.006799064576625824, 0.010027782060205936, -0.015445689670741558, -0.006812520790845156, 0.01836186833679676, -0.05224000662565231, 0.01379299070686102, -0.04091084748506546, -0.012155970558524132, 0.007083398289978504, 0.01745401695370674, -0.004345799796283245, -0.01394018903374672, 0.01190063264220953, 0.006264544557780027, -0.010990811511874199, 0.02789285220205784, -0.01643439568579197, 0.036597929894924164, 0.014594976790249348, -0.020884370431303978, 0.009451867081224918, 0.14932465553283691, -0.05749255418777466, -0.009910146705806255, -0.017921986058354378, -0.02411647140979767, 0.040553558617830276, 0.015910720452666283, 0.004087766632437706, -0.07585053145885468, -0.004404752515256405, -0.041539959609508514, 0.03819143399596214, -0.005743307992815971, 0.04058704525232315, -0.008798099122941494, 0.022050920873880386, -0.060121193528175354, 0.013004169799387455, 0.010248459875583649, -0.00971163623034954, -0.0014004865661263466, 0.029527192935347557, 0.02066289260983467, 0.03607502952218056, -0.0013253266224637628, 0.019731104373931885, -0.06858145445585251, 0.004605697933584452, -0.0033920835703611374, -0.016833489760756493, 0.016499796882271767, -0.03222278505563736, -0.06144535169005394, 0.030162114650011063, -0.02231021411716938, -0.029742101207375526, 0.016167033463716507, -0.023932073265314102, -0.02730236016213894, 0.021338513121008873, -0.008258572779595852, -0.001745893037877977, -0.020930301398038864, -0.0058139171451330185, 0.019884459674358368, -0.015566257759928703, 0.015157409012317657, 0.08047982305288315, 0.01555826235562563, 0.03912244737148285, -0.014024664647877216, 0.0008457184303551912, 0.00641711475327611, -0.024986527860164642, 0.0006842127186246216, -0.012981698848307133, 0.014438347890973091, -0.0051102046854794025, 0.04057725891470909, 0.02946288324892521, -0.06539943069219589, -0.08063766360282898, 0.01519730407744646, 0.01443756464868784, -0.0463564395904541, -0.02257915399968624, 0.05615081265568733, -0.00493082869797945, 0.015455045737326145, -0.04196030646562576, 0.06430622190237045, 0.028780635446310043, -0.004637269768863916]] usage=EmbeddingUsage(tokens=0, total_tokens=0, unit_price=Decimal('0.0'), price_unit=Decimal('0.0'), total_price=Decimal('0.0'), currency='USD', latency=16514386.322915519)\n"
     ]
    }
   ],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "dify",
   "language": "python",
   "name": "dify"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
